package com.zjx.shop.product.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zjx.shop.common.utils.PageParams;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjx.shop.common.utils.PageUtils;
import com.zjx.shop.product.dao.SpuImagesDao;
import com.zjx.shop.product.entity.SpuImagesEntity;
import com.zjx.shop.product.service.SpuImagesService;


@Service("spuImagesService")
public class SpuImagesServiceImpl extends ServiceImpl<SpuImagesDao, SpuImagesEntity> implements SpuImagesService {

    @Override
    public PageUtils queryPage(PageParams params) {
        IPage<SpuImagesEntity> page = this.page(
                new Page<>(params.getPage(),params.getSize()),
                new QueryWrapper<SpuImagesEntity>()
        );

        return new PageUtils(page.getCurrent(),page.getSize(),(long) page.getRecords().size(),page.getRecords());
    }

}